package com.coco.service.impl;

import com.coco.dao.RootMapper;
import com.coco.model.RootModel;
import com.coco.service.RootService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * @author GHOSTLaycoo
 * @date 2020/4/12 0012 - 下午 14:42
 */
@Service
public class RootServiceImpl implements RootService{

    @Autowired
    private RootMapper rootMapper;

    @Override
    public int save(RootModel rootModel) {
        String string = UUID.randomUUID().toString();
        rootModel.setId(string);
        return rootMapper.save(rootModel);
    }

    @Override
    public int delete(String id) {
        return rootMapper.delete(id);
    }

    @Override
    public int update(RootModel rootModel) {
        return rootMapper.update(rootModel);
    }

    @Override
    public List<RootModel> getRootByCondition(String keyWord) {
        return rootMapper.getRootByCondition(keyWord);
    }
}
